﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace SmugMugToLiveWriter
{
    public partial class CustomPictureBox : UserControl
    {
        private SmugMugModel.Image CustomImage = null;
        public bool Checked
        {
            get {  return PictureChckBx.Checked; }
            set {  PictureChckBx.Checked = value; }
        }
        public SmugMugModel.Image PctrBxImage
        {
            get {  return CustomImage; }
        }



        /// <summary>
        /// Choose the image to load
        /// </summary>
        /// <param name="imageToShow"></param>
        public CustomPictureBox(SmugMugModel.Image imageToShow)
        {
            InitializeComponent();
            CustomPctrBx.ImageLocation = imageToShow.TinyURL;
            CustomImage = imageToShow;
        }

        /// <summary>
        /// Defines the size of the loaded image
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CustomPctrBx_LoadCompleted(object sender, AsyncCompletedEventArgs e)
        {
            this.Size = CustomPctrBx.Image.Size;
        }
    }
}
